﻿@model EM.OA.Portal.Models.ProjectModels
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutContent.cshtml";
}
<script type="text/javascript" src="~/Scripts/page/Project/Project.js"></script>
<div class="easyui-layout" style="height: 500px; overflow: hidden;">
    <div data-options="region:'west',split:true,title:'项目管理'" style="width: 150px; padding: 10px;">
        <ul id="tree" class="easyui-tree">
        </ul>
    </div>
    <div data-options="region:'center',title:''">
        @*list*@
        <table id="list" class="easyui-datagrid" toolbar="#toolbar">
        </table>
    </div>
    <div data-options="region:'east',title:''" style="width: 300px;">
        <div class="easyui-tabs" style="height: auto">
            <div title="基本信息" style="padding: 10px">
                <div>
                    @Html.LabelFor(m => m.ProjectName):
                    <label id="name"></label>
                </div>
                <div>
                    @Html.LabelFor(m => m.ProjectLevel):
                    <label id="level"></label>
                </div>
                <div>
                    @Html.LabelFor(m => m.FinishPercent):
                    <label id="percent"></label>
                </div>
                <div>
                    @Html.LabelFor(m => m.FinishTime):
                    <label id="finishTim"></label>
                </div>
                @* <div>
                    @Html.Label("附件"):
                    <label id="attach"></label>
                </div>*@
                <div>
                    @Html.LabelFor(m => m.ManageUserID):
                    <label id="managerUser"></label>
                </div>
                <div>
                    @Html.LabelFor(m => m.JoinUserIDs):
                    <label id="joinUser"></label>
                </div>
                <div>
                    @Html.LabelFor(m => m.Description):
                    <label id="desc"></label>
                </div>
            </div>
            <div title="项目交流" style="padding: 10px">
                @*                <iframe src="ProjectChat/Index" style="border: 0px"></iframe>*@
                <a href="#" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="addChat()">发布留言</a>
                @*list*@
                <table id="listChat" class="easyui-datagrid">
                </table>

            </div>
        </div>
    </div>
</div>

<div id="toolbar">
    <a href="#" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="add()">增加</a>
    <a href="#" class="easyui-linkbutton" iconcls="icon-edit" plain="true" onclick="edit()">修改</a>
    <a href="#" class="easyui-linkbutton" iconcls="icon-remove" plain="true" onclick="del()">删除</a>
    <div id="tb" style="padding: 3px">
        <span>@Html.LabelFor(m => m.ProjectName)</span>
        <input id="ProjectName" name="ProjectName">
        <a href="#" class="easyui-linkbutton" plain="true" onclick="doSearch()">查询</a>
    </div>
</div>

@*Detail*@
<div id="dlg" class="easyui-dialog" style="width: 800px; height: 500px; padding: 10px 20px"
    closed="true" buttons="#dlg-buttons" modal="true" resizable="true" data-options="
    onOpen:function() { 
    keditor =  KindEditor.create('#Description',{
    items : [
						'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
						'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
						'insertunorderedlist', '|', 'emoticons', 'image', 'link']    }); 

     },
    onBeforeClose:function() { 
    keditor.html(''); 
    keditor.remove('#Description');
    },
    onClose: function () {
        //解决弹出窗口关闭后，验证消息还显示在最上面
        $('.validatebox-tip').remove();
    }
    ">
    <div id="dlg-buttons">
        <a href="#" class="easyui-linkbutton" iconcls="icon-ok" onclick="save()">保存</a>
        <a href="#" class="easyui-linkbutton" iconcls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">取消</a>
    </div>

    <form id="fm" method="post" novalidate="novalidate">
        @Html.HiddenFor(m => m.ProjectID)
        @Html.Hidden("refID", @ViewData["refID"].ToString())
        <div>
            @Html.LabelFor(m => m.ProjectName)
            <input name="ProjectName" class="easyui-validatebox" data-options="required:true,validType:'length[1,100]'">
            @Html.LabelFor(m => m.ProjectCode)
            <input name="ProjectCode" class="easyui-validatebox" data-options="required:true,validType:'length[1,50]'">
        </div>
        <div>
            @Html.LabelFor(m => m.Description)
            <textarea id="Description" name="Description" style="width: 500px; height: 300px;" class="easyui-validatebox"></textarea>
        </div>
        <div>
            @Html.LabelFor(m => m.StartTime)
            <input name="StartTime" class="easyui-datebox" data-options="required:true" />
            @Html.LabelFor(m => m.IsASAPStart)
            @Html.CheckBoxFor(m => m.IsASAPStart)
        </div>
        <div>
            @Html.LabelFor(m => m.FinishTime)
            <input name="FinishTime" class="easyui-datebox" />
            @Html.LabelFor(m => m.IsASAPFinish)
            @Html.CheckBoxFor(m => m.IsASAPFinish)
        </div>
        <div>
            @Html.LabelFor(m => m.ProjectLevel)
            @Html.DropDownListFor(m => m.ProjectLevel, new EM.OA.WebCommon.Base.BaseViewModel().GetListItems("ProjectLevelKind"), new { @class = "easyui-combobox" })
            @Html.LabelFor(m => m.FinishPercent)
            <input name="FinishPercent" class="easyui-numberbox" data-options="min:0,max:100" />
        </div>
        <div>
            @Html.Label("管理人")
            <input type="hidden" id="ManageUserID" name="ManageUserID" />
            <input class="easyui-validatebox" type="text" id="ManageUserIDName" name="ManageUserIDName" />
            <a href="#" class="easyui-linkbutton" onclick="GetUserList()" plain="true">选择</a>
        </div>
        <div>
            @Html.Label("参与人")
            <input type="hidden" id="JoinUserIDs" name="JoinUserIDs" />
            <input class="easyui-validatebox" type="text" id="JoinUserIDsName" name="JoinUserIDsName" />
            <a href="#" class="easyui-linkbutton" onclick="GetUserListMulti()" plain="true">选择</a>
        </div>
        <div>
            <iframe id="frmUploadFile" style="border: 0px; width: 100%;" src="Attachment/Index?refID=@ViewData["refID"]"></iframe>
        </div>

    </form>
</div>

@*Chat*@

<div>

    @*Detail*@
    <div id="dlgChat" class="easyui-dialog" style="width: 600px; height: 400px; padding: 10px 20px"
        closed="true" buttons="#dlg-buttons-chat" modal="true" resizable="true" data-options="
    onOpen:function() { 
    keditorChat =  KindEditor.create('#ChatContent',{
    items : [
						'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
						'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
						'insertunorderedlist', '|', 'emoticons', 'image', 'link']    }); 

     },
    onBeforeClose:function() { 
    keditorChat.html(''); 
    keditorChat.remove('#ChatContent');
    }
    ">
        <div id="dlg-buttons-chat">
            <a href="#" class="easyui-linkbutton" iconcls="icon-ok" onclick="saveChat()">保存</a>
            <a href="#" class="easyui-linkbutton" iconcls="icon-cancel" onclick="javascript:$('#dlgChat').dialog('close')">取消</a>
        </div>
        <form id="fmChat" method="post" novalidate="novalidate">
            @Html.Hidden("hidProjectID")
            @*            @Html.HiddenFor(m => m.ProjectChatModel.ProjectID)*@
            <div>
                @Html.Label("标题")
                <input id="ChatTitle" name="ChatTitle" class="easyui-validatebox" data-options="required:true,validType:'length[1,200]'">
            </div>
            <div>
                @Html.Label("内容")
                <textarea id="ChatContent" name="ChatContent" style="height: 250px; width: 90%" class="easyui-validatebox" data-options="required:true"></textarea>
            </div>
        </form>
    </div>

</div>
@Html.Partial("_OrgUserPartial", new List<object> { true, "ManageUserID", "ManageUserIDName" })
@Html.Partial("_OrgUserMultiPartial", new List<object> { "JoinUserIDs", "JoinUserIDsName" })
